﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BoriPeter.FitnessJournal8.Models
{
    public enum FoodOrderByType
    {
        Name,
        Brand,
        Date
    }
    public class FoodOrderBy : ModelBase
    {
        private string label;
        public string Label
        {
            get
            {
                return this.label;
            }

            set
            {
                this.label = value;
                NotifyOfPropertyChange("Label");
            }
        }

        private string name;
        public string Name
        {
            get
            {
                return this.name;
            }

            set
            {
                this.name = value;
                NotifyOfPropertyChange("Name");
            }
        }

        private FoodOrderByType orderByTye;
        public FoodOrderByType OrderByType
        {
            get
            {
                return this.orderByTye;
            }

            set
            {
                this.orderByTye = value;
                NotifyOfPropertyChange("OrderByType");
            }
        }

        public FoodOrderBy(string _label, string _name, FoodOrderByType _type)
            : base()
        {
            label = _label;
            name = _name;
            orderByTye = _type;
        }

        private static List<FoodOrderBy> defaultList;
        public static List<FoodOrderBy> DefaultList
        {
            get
            {
                if (defaultList == null)
                {
                    defaultList = new List<FoodOrderBy>();
                    defaultList.Add(new FoodOrderBy("Name", "name", FoodOrderByType.Name));
                    defaultList.Add(new FoodOrderBy("Brand", "brand", FoodOrderByType.Brand));
                    defaultList.Add(new FoodOrderBy("Date", "date", FoodOrderByType.Date));
                }
                return defaultList;
            }
        }
    }
}
